//
//  NewSwift4.swift
//  ProjectDemo
//
//  Created by caoxiaozhu on 2018/8/11.
//  Copyright © 2018年 caoxiaozhu. All rights reserved.
//

import UIKit

class NewSwift4: UIViewController {
    
    //showLabel
    var showLabel : UILabel {
        let label = UILabel()
        label.center = view.center
        label.text = "默认label"
        label.numberOfLines = 0
        label.textAlignment = .center
        label.sizeToFit()
        return label
    }
    
    //string
    var showStr : String = ""

    override func viewDidLoad() {
        super.viewDidLoad()

        setupUI()
        test1()
    }
    
    func setupUI(){
        view.backgroundColor = UIColor.white
        view.addSubview(showLabel)
    }
}

extension NewSwift4{
    
    //TODO: 新的字符串免转义
    func test1(){
        showStr = """
                这是一个多行字符串
                不需要任何符号去转义
                就能显示在屏幕中间
                你说神奇不神气
                """
        showLabel.text = showStr
    }
}
